<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/public/js/jquery.js"></script>
    <script src="/public/js/index.js"></script>
    <style>
        *{
            padding:0;
            maring:0;
        }
        .line input{
            width: 100px;
            line-height: 40px;
        }
        .mt50{
            margin-top:50px;
        }
    </style>
</head>
<body>
{% if userInfo._id%}
<div class="mt50">
    <div class="uesrbox" id="userInfo">
        <div>用户信息</div>
        <div class="username">{{userInfo.username}}</div>
        {% if userInfo.isAdmin%}
        <div class="info">你好,管理员</div>
        <a href="/admin">进入管理</a>
        {%else%}
        <div class="info">你好欢迎光临我的博客</div>
        {%endif%}

        <div><a href="javascript:;" id="logout">退出</a></div>
    </div>
</div>
{% else %}
<div id="loginBox" class="mt50">
    <div>登录</div>
    <div class="line">用户名：<input name="username" type="text"/></div>
    <div class="line">密码：<input name="password" type="password"/></div>
    <div><button type="button">登录</button></div>
    <div><a href="javascript:;">马上注册</a></div>
    <div class="colWarning"></div>
</div>
<div class="rightBox mt50" id="registerBox">
    <div>注册</div>
    <div class="line">用户名：<input name="username" type="text"/></div>
    <div class="line">密码：<input name="password" type="password"/></div>
    <div class="line">确认：<input name="repassword" type="password"/></div>
    <div><button type="button">注册</button></div>
    <div><a href="javascript:;">马上登陆</a></div>
    <div class="colWarning"></div>
</div>
{% endif %}

<div>
    <a href="/">首页</a>
    {%for cate in categories%}
    <a href="/?category={{cate.id}}">{{cate.name}}</a>
    {%endfor%}
</div>
<div class="mt50">
   {%block content%}{%endblock%}
</div>

</body>

</html>